const TOKEN = localStorage.token;
import {developUrl,serverDK} from '@/views/api/api'
//const developUrl = 'http://192.168.1.183:';/*英子*/
//const serverDK ='9587/';
import Vue from 'vue';
import axios from 'axios';


export const apiGetYuanData = (param) => {
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'metaData/list',
			data:param}).then((res) => res).catch((error) => {console.log('出错',error);});};

export const apiGetYuanDataDeatil = (param) => {
  return axios({method : 'get',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'metaData/detail/'+param.id,
  }).then((res) => res).catch((error) => {console.log('出错',error);});};

export const apiDelYuanData = (param) => {
  return axios({
    	method : 'get',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'metaData/del/'+param.id,
  }).then((res) => res)
.catch((error) => {
   console.log('出错',error);
 });
};


export const apiAddYuanData = (param) => {
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'metaData/add',
    	data:param
  }).then((res) => res).catch((error) => {console.log('出错',error);});};



export const  apiUpdataYuanData = (param)=>{
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'metaData/update',
    	data:param
  }).then((res) => res).catch((error) => {console.log('出错',error);});};




export const  apiConnDataList = (param)=>{
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'connData/list',
    	data:param
  }).then((res) => res).catch((error) => {console.log('出错',error);});};
  


export const  apiConnDataDetail = (param)=>{
  return axios({method : 'get',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'connData/detail/'+param.id,
    	data:param
  }).then((res) => res).catch((error) => {console.log('出错',error);});};


export const  apiConnDataDel = (param)=>{
  return axios({method : 'get',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'connData/del/'+param.id,
    	data:param
  }).then((res) => res).catch((error) => {console.log('出错',error);});};



export const  apiConnDataAdd = (param)=>{
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'connData/add',
    	data:param
  }).then((res) => res).catch((error) => {console.log('出错',error);});};



export const  apiConnDataUpdata = (param)=>{
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'connData/update',
    	data:param
  }).then((res) => res).catch((error) => {console.log('出错',error);});};



export const apiGetYwType = (param) => {/*获取业务类型，网段区域，信息类型*/
  return axios({
    	method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'dictionary/tree/search',
		data:{
			"type":param
		},
  }).then((res) => res)
.catch((error) => {
   console.log('出错',error);
 });
};


export const  apiGetArea = (param)=>{
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'area/search',
    	data:{
    		"segment":param.segment
    	}
  }).then((res) => res).catch((error) => {console.log('出错',error);});};


